/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package br.com.systemcar.model;

import java.io.Serializable;
import java.util.Date;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Lob;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import javax.xml.bind.annotation.XmlRootElement;

/**
 *
 * @author danilo
 */
@Entity
@Table(name = "posto")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "Posto.findAll", query = "SELECT p FROM Posto p"),
    @NamedQuery(name = "Posto.findByPstId", query = "SELECT p FROM Posto p WHERE p.pstId = :pstId"),
    @NamedQuery(name = "Posto.findByPstNome", query = "SELECT p FROM Posto p WHERE p.pstNome = :pstNome"),
    @NamedQuery(name = "Posto.findByPstLogo", query = "SELECT p FROM Posto p WHERE p.pstLogo = :pstLogo"),
    @NamedQuery(name = "Posto.findByPstSigla", query = "SELECT p FROM Posto p WHERE p.pstSigla = :pstSigla"),
    @NamedQuery(name = "Posto.findByPstDatacadastro", query = "SELECT p FROM Posto p WHERE p.pstDatacadastro = :pstDatacadastro"),
    @NamedQuery(name = "Posto.findByPstAtivo", query = "SELECT p FROM Posto p WHERE p.pstAtivo = :pstAtivo"),
    @NamedQuery(name = "Posto.findByUsrId", query = "SELECT p FROM Posto p WHERE p.usrId = :usrId")})
public class Posto implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Basic(optional = false)
    @Column(name = "pst_id")
    private Integer pstId;
    @Basic(optional = false)
    @NotNull
    @Size(min = 1, max = 150)
    @Column(name = "pst_nome")
    private String pstNome;
    @Size(max = 150)
    @Column(name = "pst_logo")
    private String pstLogo;
    @Basic(optional = false)
    @NotNull
    @Size(min = 1, max = 100)
    @Column(name = "pst_sigla")
    private String pstSigla;
    @Column(name = "pst_datacadastro")
    @Temporal(TemporalType.TIMESTAMP)
    private Date pstDatacadastro;
    @Lob
    @Size(max = 65535)
    @Column(name = "pst_observacao")
    private String pstObservacao;
    @Size(max = 2)
    @Column(name = "pst_ativo")
    private String pstAtivo;
    @Column(name = "usr_id")
    private Integer usrId;

    public Posto() {
    }

    public Posto(Integer pstId) {
        this.pstId = pstId;
    }

    public Posto(Integer pstId, String pstNome, String pstSigla) {
        this.pstId = pstId;
        this.pstNome = pstNome;
        this.pstSigla = pstSigla;
    }

    public Integer getPstId() {
        return pstId;
    }

    public void setPstId(Integer pstId) {
        this.pstId = pstId;
    }

    public String getPstNome() {
        return pstNome;
    }

    public void setPstNome(String pstNome) {
        this.pstNome = pstNome;
    }

    public String getPstLogo() {
        return pstLogo;
    }

    public void setPstLogo(String pstLogo) {
        this.pstLogo = pstLogo;
    }

    public String getPstSigla() {
        return pstSigla;
    }

    public void setPstSigla(String pstSigla) {
        this.pstSigla = pstSigla;
    }

    public Date getPstDatacadastro() {
        return pstDatacadastro;
    }

    public void setPstDatacadastro(Date pstDatacadastro) {
        this.pstDatacadastro = pstDatacadastro;
    }

    public String getPstObservacao() {
        return pstObservacao;
    }

    public void setPstObservacao(String pstObservacao) {
        this.pstObservacao = pstObservacao;
    }

    public String getPstAtivo() {
        return pstAtivo;
    }

    public void setPstAtivo(String pstAtivo) {
        this.pstAtivo = pstAtivo;
    }

    public Integer getUsrId() {
        return usrId;
    }

    public void setUsrId(Integer usrId) {
        this.usrId = usrId;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (pstId != null ? pstId.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Posto)) {
            return false;
        }
        Posto other = (Posto) object;
        if ((this.pstId == null && other.pstId != null) || (this.pstId != null && !this.pstId.equals(other.pstId))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "br.com.systemcar.model.Posto[ pstId=" + pstId + " ]";
    }
    
}
